/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* GitHub Dark Theme Colors */
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1c2128;
  --bg-overlay: #21262d;

  --text-primary: #e6edf3;
  --text-secondary: #7d8590;
  --text-muted: #484f58;

  --border-primary: #30363d;
  --border-secondary: #21262d;
  --border-muted: #373e47;

  --accent-primary: #d57455;
  --accent-hover: #e08567;
  --accent-active: #c46343;

  --success: #238636;
  --success-emphasis: #2ea043;
  --danger: #da3633;
  --warning: #d29922;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Sidebar */
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 60px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.6);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  transition: width var(--transition-normal), transform var(--transition-normal);
  z-index: 100;
  overflow: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  transition: opacity var(--transition-fast);
}

.sidebar.collapsed .sidebar-logo .logo-text {
  display: none;
}

.logo-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.sidebar-toggle {
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  padding: var(--spacing-sm);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-muted);
}

.toggle-icon {
  font-size: 1.125rem;
}

.sidebar-stats {
  padding: var(--spacing-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
  border-bottom: 1px solid var(--border-primary);
}

.sidebar.collapsed .sidebar-stats {
  grid-template-columns: 1fr;
  padding: var(--spacing-md);
}

.sidebar-stat {
  text-align: center;
  padding: var(--spacing-md);
  background: var(--bg-tertiary);
  border-radius: 8px;
  transition: transform var(--transition-fast);
}

.sidebar-stat:hover {
  transform: translateY(-2px);
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1;
}

.stat-text {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: var(--spacing-xs);
  white-space: nowrap;
}

.sidebar.collapsed .stat-text {
  display: none;
}

.sidebar-section {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-primary);
}

.sidebar.collapsed .sidebar-section {
  padding: var(--spacing-md);
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.sidebar.collapsed .section-title {
  display: none;
}

.section-count {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  font-weight: 600;
}

.marketplace-filters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-xs);
}

.sidebar.collapsed .marketplace-filters {
  display: none;
}

.marketplace-filter-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  color: var(--text-secondary);
  padding: var(--spacing-sm) var(--spacing-xs);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.marketplace-filter-btn:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.marketplace-filter-btn.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-md);
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--border-muted);
}

.marketplace-item {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: var(--spacing-md);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  transition: all var(--transition-fast);
  margin-bottom: var(--spacing-xs);
  text-align: left;
  position: relative;
}

.marketplace-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-muted);
}

.marketplace-item.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.marketplace-item.disabled {
  opacity: 0.6;
}

.marketplace-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.marketplace-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sidebar.collapsed .marketplace-info {
  display: none;
}

.marketplace-name {
  font-weight: 500;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.marketplace-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.marketplace-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.marketplace-status.enabled {
  background: var(--success);
}

.marketplace-status.disabled {
  background: var(--text-muted);
}

.sidebar.collapsed .marketplace-status {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
}

.sidebar-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  color: var(--text-secondary);
  gap: var(--spacing-md);
}

.sidebar-empty {
  text-align: center;
  padding: var(--spacing-xl);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.sidebar-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.sidebar.collapsed .sidebar-footer {
  padding: var(--spacing-md);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
}

.sidebar-link:hover {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
}

.link-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
}

.sidebar.collapsed .link-text {
  display: none;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-normal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

.top-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  padding: var(--spacing-lg) var(--spacing-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar-left {
  flex: 1;
  min-width: 200px;
}

.page-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
}

.title-icon {
  font-size: 1.75rem;
}

.breadcrumb {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: var(--spacing-md);
  color: var(--text-secondary);
  pointer-events: none;
}

.search-input {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) 2.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  width: 250px;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.view-controls {
  display: flex;
  gap: var(--spacing-xs);
  background: var(--bg-tertiary);
  padding: var(--spacing-xs);
  border-radius: 8px;
  border: 1px solid var(--border-primary);
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-btn:hover {
  color: var(--text-primary);
  background: var(--bg-overlay);
}

.view-btn.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

.view-icon {
  font-size: 1rem;
}

.filters-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-primary);
  padding: var(--spacing-md) var(--spacing-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
  position: sticky;
  top: 78px;
  z-index: 40;
}

.filter-group {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.filter-chip {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
  border-color: var(--border-muted);
}

.filter-chip.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
}

.chip-badge {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.filter-chip.active .chip-badge {
  background: rgba(0, 0, 0, 0.3);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.enabled {
  background: var(--success);
}

.status-dot.disabled {
  background: var(--text-muted);
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.sort-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.sort-select {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sort-select:hover {
  border-color: var(--border-muted);
}

.sort-select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* ==================== PLUGINS CONTAINER ==================== */
.plugins-container {
  flex: 1;
  padding: var(--spacing-xl);
  overflow-y: auto;
}

.plugins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--spacing-lg);
  animation: fadeIn var(--transition-normal);
  align-items: start;
}

.plugins-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  animation: fadeIn var(--transition-normal);
}

/* Plugin Card (Grid View) */
.plugin-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: var(--spacing-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  position: relative;
  overflow: hidden;
  height: fit-content;
}

.plugin-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-primary);
  transform: scaleX(0);
  transition: transform var(--transition-normal);
}

.plugin-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.plugin-card:hover::before {
  transform: scaleX(1);
}

.plugin-card.disabled {
  opacity: 0.7;
}

.plugin-card.disabled:hover {
  transform: translateY(-2px);
}

.plugin-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
}

.plugin-card-status {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.plugin-card-status.enabled {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.plugin-card-status.disabled {
  background: var(--text-muted);
}

.plugin-card-title {
  flex: 1;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.plugin-card-version {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.25rem 0.625rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  flex-shrink: 0;
}

.plugin-card-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plugin-card-components {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-sm);
}

.component-badge {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  padding: var(--spacing-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: all var(--transition-fast);
}

.plugin-card:hover .component-badge {
  border-color: var(--border-muted);
}

.component-icon {
  font-size: 1.125rem;
}

.component-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-primary);
}

.plugin-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-secondary);
  font-size: 0.75rem;
}

.plugin-card-marketplace {
  color: var(--text-secondary);
  font-weight: 500;
}

.plugin-card-total {
  color: var(--text-muted);
}

/* Plugin List Item (List View) */
.plugin-list-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: var(--spacing-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  position: relative;
}

.plugin-list-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-primary);
  transform: scaleY(0);
  transition: transform var(--transition-normal);
  border-radius: 10px 0 0 10px;
}

.plugin-list-item:hover {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
  box-shadow: var(--shadow-md);
}

.plugin-list-item:hover::before {
  transform: scaleY(1);
}

.plugin-list-item.disabled {
  opacity: 0.7;
}

.plugin-list-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.plugin-list-status.enabled {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.plugin-list-status.disabled {
  background: var(--text-muted);
}

.plugin-list-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.plugin-list-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.plugin-list-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.plugin-list-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.plugin-list-meta {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.plugin-list-version {
  background: var(--bg-overlay);
  padding: 0.125rem 0.5rem;
  border-radius: 8px;
}

.plugin-list-components {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border-secondary);
}

.component-badge-sm {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 0.875rem;
}

.component-badge-sm .component-icon {
  font-size: 1rem;
}

.component-badge-sm .component-value {
  font-weight: 600;
  color: var(--accent-primary);
}

.plugin-list-action {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.plugin-list-item:hover .plugin-list-action {
  color: var(--accent-primary);
  transform: translateX(4px);
}

.action-icon {
  font-size: 1.25rem;
}

/* ==================== LOADING & EMPTY STATES ==================== */
.content-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  min-height: 300px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-primary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-large {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border-primary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  margin-top: var(--spacing-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.empty-state-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  min-height: 400px;
}

.empty-state {
  text-align: center;
  max-width: 400px;
}

.empty-icon {
  font-size: 4rem;
  opacity: 0.3;
  margin-bottom: var(--spacing-lg);
}

.empty-title {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.empty-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: var(--spacing-lg);
}

/* ==================== MODAL ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  padding: var(--spacing-lg);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

.modal-container::-webkit-scrollbar {
  width: 8px;
}

.modal-container::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

.modal-container::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.modal-header {
  padding: var(--spacing-xl);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacing-lg);
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 10;
}

.modal-title-section {
  flex: 1;
  min-width: 0;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.modal-badges {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.modal-badge {
  padding: 0.375rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.modal-badge.version-badge {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-secondary);
}

.modal-badge.status-badge.enabled {
  background: var(--success);
  color: white;
}

.modal-badge.status-badge.disabled {
  background: var(--text-muted);
  color: white;
}

.modal-close-btn {
  background: transparent;
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-muted);
}

.close-icon {
  font-size: 1.25rem;
  font-weight: 300;
}

.modal-body {
  padding: var(--spacing-xl);
}

.modal-section {
  margin-bottom: var(--spacing-xl);
}

.modal-section:last-child {
  margin-bottom: 0;
}

.modal-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

.modal-description {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.modal-components-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-md);
}

.modal-component-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: 10px;
  padding: var(--spacing-md);
  text-align: center;
  transition: all var(--transition-fast);
}

.modal-component-card:hover {
  border-color: var(--border-muted);
  transform: translateY(-2px);
}

.modal-component-icon {
  font-size: 1.75rem;
  margin-bottom: var(--spacing-sm);
}

.modal-component-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.modal-component-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-details-grid {
  display: grid;
  gap: var(--spacing-sm);
}

.detail-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  padding: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-md);
}

.detail-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

.keywords-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

.keyword-tag {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  color: var(--text-secondary);
  padding: 0.375rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.keyword-tag:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ==================== BUTTONS ==================== */
.btn-primary {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border: none;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-block {
  width: 100%;
}

.btn-icon {
  font-size: 1.125rem;
}

/* ==================== ANIMATIONS ==================== */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
  .plugins-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .search-input {
    width: 200px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar.collapsed ~ .main-content {
    margin-left: 0;
  }

  .top-bar {
    padding: var(--spacing-md) var(--spacing-lg);
  }

  .page-title {
    font-size: 1.25rem;
  }

  .search-input {
    width: 150px;
  }

  .filters-bar {
    padding: var(--spacing-md) var(--spacing-lg);
    flex-direction: column;
    align-items: flex-start;
  }

  .plugins-container {
    padding: var(--spacing-lg);
  }

  .plugins-grid {
    grid-template-columns: 1fr;
  }

  .plugin-card-components {
    grid-template-columns: repeat(2, 1fr);
  }

  .plugin-list-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .plugin-list-components {
    width: 100%;
    justify-content: space-around;
  }

  .modal-components-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-header,
  .modal-body {
    padding: var(--spacing-lg);
  }

  .detail-card {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-sm);
  }

  .detail-value {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .top-bar-right {
    width: 100%;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .search-input {
    width: 100%;
  }

  .view-controls {
    width: 100%;
    justify-content: center;
  }

  .filter-group {
    width: 100%;
  }

  .filter-chip {
    flex: 1;
    justify-content: center;
  }

  .modal-components-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== PLUGIN ACTIONS ==================== */
.plugin-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
}

.action-button {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  color: var(--text-primary);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  transition: all var(--transition-fast);
}

.action-button:hover {
  background: var(--bg-overlay);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.action-button:active {
  transform: translateY(0);
}

.action-button.install-btn {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.action-button.install-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
}

.action-button.enable-btn {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.action-button.enable-btn:hover {
  background: var(--success-emphasis);
  border-color: var(--success-emphasis);
  color: white;
}

.action-button.disable-btn {
  background: var(--warning);
  color: white;
  border-color: var(--warning);
}

.action-button.disable-btn:hover {
  background: #e0a928;
  border-color: #e0a928;
  color: white;
}

.action-button.uninstall-btn {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.action-button.uninstall-btn:hover {
  background: #e04643;
  border-color: #e04643;
  color: white;
}

.action-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-button:disabled:hover {
  transform: none;
  box-shadow: none;
}

.action-icon {
  font-size: 1.125rem;
}

/* ==================== COMMAND REFERENCE ==================== */
.command-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.command-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: 10px;
  padding: var(--spacing-md);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--spacing-md);
  align-items: center;
  transition: all var(--transition-fast);
  position: relative;
}

.command-item:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.command-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  min-width: 140px;
}

.command-icon {
  font-size: 1.25rem;
}

.command-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.command-code {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  padding: var(--spacing-sm) var(--spacing-md);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.8125rem;
  color: var(--accent-primary);
  overflow-x: auto;
  white-space: nowrap;
}

.command-code::-webkit-scrollbar {
  height: 4px;
}

.command-code::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

.command-code::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 2px;
}

.command-copy-btn {
  background: var(--bg-overlay);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.command-copy-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  transform: scale(1.1);
}

.command-copy-btn:active {
  transform: scale(0.95);
}

/* ==================== TOAST NOTIFICATION ==================== */
.toast {
  position: fixed;
  bottom: var(--spacing-xl);
  right: var(--spacing-xl);
  background: var(--success);
  color: white;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-normal);
  z-index: 2000;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.toast-icon {
  font-size: 1.25rem;
}

.toast-message {
  white-space: nowrap;
}

/* ==================== RESPONSIVE - Commands ==================== */
@media (max-width: 768px) {
  .command-item {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  .command-header {
    min-width: auto;
  }

  .command-code {
    width: 100%;
  }

  .command-copy-btn {
    width: 100%;
    justify-content: center;
  }

  .plugin-actions-grid {
    grid-template-columns: 1fr;
  }

  .toast {
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    left: var(--spacing-lg);
  }
}

/* ==================== REFRESH BUTTON ==================== */
.refresh-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-right: var(--spacing-sm);
}

.refresh-btn:hover {
  background: var(--bg-overlay);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.refresh-btn:active {
  transform: scale(0.95);
}

.refresh-btn.refreshing .refresh-icon {
  animation: spin 1s linear infinite;
}

.refresh-icon {
  font-size: 1.125rem;
  transition: transform var(--transition-normal);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ==================== SKILLS SPECIFIC STYLES ==================== */

/* Skills Grid */
.skills-container {
  padding: var(--spacing-xl);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--spacing-lg);
  max-width: 100%;
}

.skills-container.list-view {
  grid-template-columns: 1fr;
  max-width: 1200px;
}

/* Skill Card */
.skill-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: var(--spacing-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover));
  transform: scaleX(0);
  transition: transform var(--transition-fast);
}

.skill-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.skill-card:hover::before {
  transform: scaleX(1);
}

.skill-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
  gap: var(--spacing-sm);
}

.skill-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.skill-source-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.skill-source-badge.personal {
  background: rgba(56, 139, 253, 0.15);
  color: #58a6ff;
  border: 1px solid rgba(56, 139, 253, 0.3);
}

.skill-source-badge.project {
  background: rgba(163, 113, 247, 0.15);
  color: #a371f7;
  border: 1px solid rgba(163, 113, 247, 0.3);
}

.skill-source-badge.plugin {
  background: rgba(57, 211, 83, 0.15);
  color: #3dd68c;
  border: 1px solid rgba(57, 211, 83, 0.3);
}

.skill-card-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: var(--spacing-md);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.skill-card-meta {
  display: flex;
  gap: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-secondary);
}

.skill-meta-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.skill-meta-icon {
  font-size: 1rem;
}

.skill-meta-value {
  color: var(--text-secondary);
  font-weight: 500;
}

/* ==================== PROGRESSIVE CONTEXT LOADING DIAGRAM ==================== */

.skill-context-section {
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.context-diagram {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.context-box {
  position: relative;
  border-radius: 12px;
  padding: var(--spacing-lg);
  min-height: 120px;
  transition: all var(--transition-normal);
}

/* Main Context - Orange/Coral (Always Loaded) */
.main-context {
  background: linear-gradient(135deg, rgba(213, 116, 85, 0.1), rgba(213, 116, 85, 0.05));
  border: 2px solid rgba(213, 116, 85, 0.4);
}

.main-context .context-header {
  color: #ff9b7a;
}

/* Discovery Context - Green (Loaded on Demand) */
.discovery-context {
  background: linear-gradient(135deg, rgba(46, 160, 67, 0.1), rgba(46, 160, 67, 0.05));
  border: 2px dashed rgba(46, 160, 67, 0.4);
}

.discovery-context .context-header {
  color: #56d364;
}

/* Progressive Context - Purple (Progressive Loading) */
.progressive-context {
  background: linear-gradient(135deg, rgba(163, 113, 247, 0.1), rgba(163, 113, 247, 0.05));
  border: 2px dashed rgba(163, 113, 247, 0.4);
}

.progressive-context .context-header {
  color: #a371f7;
}

.context-header {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.context-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
}

.context-badge.always-loaded {
  background: rgba(213, 116, 85, 0.2);
  color: #ff9b7a;
  border: 1px solid rgba(213, 116, 85, 0.5);
}

.context-badge.on-demand {
  background: rgba(46, 160, 67, 0.2);
  color: #56d364;
  border: 1px solid rgba(46, 160, 67, 0.5);
}

.context-badge.progressive {
  background: rgba(163, 113, 247, 0.2);
  color: #a371f7;
  border: 1px solid rgba(163, 113, 247, 0.5);
}

.context-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.context-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--bg-overlay);
  border-radius: 8px;
  transition: all var(--transition-fast);
}

.context-item:hover {
  background: var(--bg-tertiary);
  transform: translateX(4px);
}

.file-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.file-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
}

.file-name {
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.file-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.no-files {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-style: italic;
  margin: var(--spacing-md) 0;
}

/* ==================== SKILL TOOLS SECTION ==================== */

.skill-tools-section {
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.tools-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem 0.75rem;
  background: var(--bg-overlay);
  border: 1px solid var(--border-primary);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.tool-chip:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.tool-chip::before {
  content: '🔧';
  font-size: 0.875rem;
}

/* ==================== FILE TREE ==================== */

.skill-files-section {
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.file-tree {
  background: var(--bg-overlay);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: var(--spacing-lg);
  margin-top: var(--spacing-md);
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
  max-height: 400px;
  overflow-y: auto;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 0.375rem var(--spacing-sm);
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition-fast);
  position: relative;
}

.tree-item:hover {
  background: var(--bg-tertiary);
}

.tree-item.active {
  background: rgba(213, 116, 85, 0.15);
  color: var(--accent-primary);
}

.tree-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.tree-label {
  flex: 1;
  color: var(--text-secondary);
}

.tree-item.active .tree-label {
  color: var(--accent-primary);
  font-weight: 600;
}

.tree-size {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* ==================== CONTENT VIEWER ==================== */

.skill-content-section {
  margin-top: var(--spacing-xl);
  display: none;
}

.skill-content-section.active {
  display: block;
}

.content-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
}

.content-viewer {
  background: var(--bg-overlay);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: var(--spacing-lg);
  max-height: 600px;
  overflow: auto;
}

.content-viewer pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.content-viewer code {
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-primary);
}

/* ==================== MODAL ENHANCEMENTS ==================== */

.skill-modal {
  max-width: 1000px;
  width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
}



/* Source Filter Buttons */
.source-filters {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  padding: var(--spacing-md) 0;
}

.source-filter-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  font-size: 0.875rem;
  font-weight: 500;
}

.source-filter-btn:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.source-filter-btn.active {
  background: rgba(213, 116, 85, 0.15);
  color: var(--accent-primary);
}

/* Status Dots */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.25rem;
}

.status-dot.personal {
  background: #58a6ff;
}

.status-dot.project {
  background: #a371f7;
}

.status-dot.plugin {
  background: #3dd68c;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .skills-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  
  .context-diagram {
    gap: var(--spacing-md);
  }
}

@media (max-width: 768px) {
  .skills-container {
    grid-template-columns: 1fr;
    padding: var(--spacing-md);
  }
  
  .skill-modal {
    width: 95vw;
    max-height: 95vh;
  }
  
  .context-diagram {
    gap: var(--spacing-sm);
  }
  
  .skill-card-meta {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
}

/* ==================== MODERN CONTEXT FLOW DIAGRAM ==================== */

.context-flow-diagram {
  background: linear-gradient(180deg, rgba(13, 17, 23, 0.6), rgba(22, 27, 34, 0.8));
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  padding: var(--spacing-xl);
  margin-top: var(--spacing-lg);
  position: relative;
}

/* Context Layer */
.context-layer {
  position: relative;
  margin-bottom: var(--spacing-md);
  transition: all var(--transition-normal);
}

.context-layer:last-of-type {
  margin-bottom: 0;
}

/* Layer Header */
.layer-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.layer-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.layer-header:hover::before {
  opacity: 1;
}

/* Main Layer */
.layer-main .layer-header {
  background: linear-gradient(135deg, rgba(213, 116, 85, 0.15), rgba(213, 116, 85, 0.08));
  border: 2px solid rgba(213, 116, 85, 0.4);
  box-shadow: 0 4px 12px rgba(213, 116, 85, 0.1);
}

.layer-main .layer-header::before {
  background: linear-gradient(135deg, rgba(213, 116, 85, 0.1), transparent);
}

.layer-main .layer-header:hover {
  border-color: rgba(213, 116, 85, 0.6);
  box-shadow: 0 6px 16px rgba(213, 116, 85, 0.15);
}

/* Discovery Layer */
.layer-discovery .layer-header {
  background: linear-gradient(135deg, rgba(46, 160, 67, 0.15), rgba(46, 160, 67, 0.08));
  border: 2px dashed rgba(46, 160, 67, 0.4);
  box-shadow: 0 4px 12px rgba(46, 160, 67, 0.1);
}

.layer-discovery .layer-header::before {
  background: linear-gradient(135deg, rgba(46, 160, 67, 0.1), transparent);
}

.layer-discovery .layer-header:hover {
  border-color: rgba(46, 160, 67, 0.6);
  box-shadow: 0 6px 16px rgba(46, 160, 67, 0.15);
}

/* Progressive Layer */
.layer-progressive .layer-header {
  background: linear-gradient(135deg, rgba(163, 113, 247, 0.15), rgba(163, 113, 247, 0.08));
  border: 2px dashed rgba(163, 113, 247, 0.4);
  box-shadow: 0 4px 12px rgba(163, 113, 247, 0.1);
}

.layer-progressive .layer-header::before {
  background: linear-gradient(135deg, rgba(163, 113, 247, 0.1), transparent);
}

.layer-progressive .layer-header:hover {
  border-color: rgba(163, 113, 247, 0.6);
  box-shadow: 0 6px 16px rgba(163, 113, 247, 0.15);
}

/* Layer Expand Icon */
.layer-expand-icon {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.context-layer.collapsed .layer-expand-icon {
  transform: rotate(-90deg);
}

/* Layer Title Group */
.layer-title-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex: 1;
}

.layer-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.layer-main .layer-number {
  background: rgba(213, 116, 85, 0.25);
  color: #ff9b7a;
  border: 2px solid rgba(213, 116, 85, 0.5);
}

.layer-discovery .layer-number {
  background: rgba(46, 160, 67, 0.25);
  color: #56d364;
  border: 2px solid rgba(46, 160, 67, 0.5);
}

.layer-progressive .layer-number {
  background: rgba(163, 113, 247, 0.25);
  color: #a371f7;
  border: 2px solid rgba(163, 113, 247, 0.5);
}

.layer-title {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  text-transform: uppercase;
}

/* Layer Badges */
.layer-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-always {
  background: rgba(213, 116, 85, 0.2);
  color: #ff9b7a;
  border: 1px solid rgba(213, 116, 85, 0.4);
}

.badge-demand {
  background: rgba(46, 160, 67, 0.2);
  color: #56d364;
  border: 1px solid rgba(46, 160, 67, 0.4);
}

.badge-progressive {
  background: rgba(163, 113, 247, 0.2);
  color: #a371f7;
  border: 1px solid rgba(163, 113, 247, 0.4);
}

.layer-file-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: auto;
}

/* Layer Content */
.layer-content {
  max-height: 500px;
  overflow: hidden;
  transition: max-height var(--transition-normal), opacity var(--transition-normal), margin var(--transition-normal);
  opacity: 1;
  margin-top: var(--spacing-md);
}

.context-layer.collapsed .layer-content {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
}

/* Layer Tree */
.layer-tree {
  background: var(--bg-overlay);
  border: 1px solid var(--border-secondary);
  border-radius: 10px;
  padding: var(--spacing-md);
}

.layer-main .layer-tree {
  border-left: 3px solid rgba(213, 116, 85, 0.5);
}

.layer-discovery .layer-tree {
  border-left: 3px solid rgba(46, 160, 67, 0.5);
}

.layer-progressive .layer-tree {
  border-left: 3px solid rgba(163, 113, 247, 0.5);
}

/* Tree Node */
.tree-node {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  border-radius: 6px;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.tree-node:hover {
  background: var(--bg-tertiary);
  transform: translateX(2px);
}

.tree-node::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 0;
  transition: height var(--transition-fast);
}

.tree-node:hover::before {
  height: 70%;
}

.layer-main .tree-node:hover::before {
  background: rgba(213, 116, 85, 0.8);
}

.layer-discovery .tree-node:hover::before {
  background: rgba(46, 160, 67, 0.8);
}

.layer-progressive .tree-node:hover::before {
  background: rgba(163, 113, 247, 0.8);
}

.node-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
}

.node-name {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
}

.node-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* Folder Nodes */
.tree-node.folder {
  font-weight: 600;
}

.tree-node.folder .node-icon {
  font-size: 1.25rem;
}

.tree-node-children {
  margin-left: var(--spacing-lg);
  padding-left: var(--spacing-md);
  border-left: 1px solid var(--border-secondary);
}

/* Empty Layer */
.empty-layer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  gap: var(--spacing-sm);
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2rem;
  opacity: 0.5;
}

.empty-text {
  font-size: 0.875rem;
  font-style: italic;
}

/* Flow Arrow */
.flow-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: var(--spacing-md) 0;
  position: relative;
}

.arrow-line {
  width: 2px;
  height: 32px;
  background: linear-gradient(180deg, rgba(213, 116, 85, 0.6), rgba(163, 113, 247, 0.6));
  position: relative;
  animation: pulse-flow 2s ease-in-out infinite;
}

@keyframes pulse-flow {
  0%, 100% {
    opacity: 0.6;
    box-shadow: 0 0 0 rgba(213, 116, 85, 0.4);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 12px rgba(213, 116, 85, 0.4);
  }
}

.arrow-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #d57455;
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #ffffff;
  white-space: nowrap;
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(213, 116, 85, 0.2);
  letter-spacing: 0.3px;
  text-align: center;
  line-height: 1.4;
}

.arrow-head {
  font-size: 1rem;
  color: var(--accent-primary);
  animation: bounce-arrow 2s ease-in-out infinite;
}

@keyframes bounce-arrow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .context-flow-diagram {
    padding: var(--spacing-md);
  }

  .layer-header {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .layer-title-group {
    gap: var(--spacing-xs);
  }

  .layer-title {
    font-size: 0.75rem;
  }

  .layer-badge {
    display: none;
  }

  .arrow-label {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
}

/* Interactive Highlight on Hover */
.context-layer:hover .layer-header {
  transform: translateX(2px);
}

.layer-main:hover .layer-tree {
  box-shadow: inset 0 0 0 1px rgba(213, 116, 85, 0.2);
}

.layer-discovery:hover .layer-tree {
  box-shadow: inset 0 0 0 1px rgba(46, 160, 67, 0.2);
}

.layer-progressive:hover .layer-tree {
  box-shadow: inset 0 0 0 1px rgba(163, 113, 247, 0.2);
}

/* Folder collapse functionality */
.tree-node-children.collapsed {
  display: none;
}

.tree-node.folder.collapsed .node-icon::before {
  content: '📁';
}

.tree-node.folder:not(.collapsed) .node-icon::before {
  content: '📂';
}

.tree-node.folder .node-icon {
  position: relative;
}

.tree-node.folder .node-icon::before {
  position: absolute;
  left: 0;
  top: 0;
}

/* ==================== MODAL FOOTER STYLES ==================== */

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  border-radius: 0 0 16px 16px;
  gap: var(--spacing-lg);
}

.modal-meta {
  display: flex;
  gap: var(--spacing-lg);
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 0.875rem;
}

.meta-label {
  color: var(--text-muted);
  font-weight: 500;
}

.meta-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* Buttons in footer */
.modal-footer .btn-primary {
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(213, 116, 85, 0.2);
}

.modal-footer .btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent-active));
  box-shadow: 0 4px 12px rgba(213, 116, 85, 0.3);
  transform: translateY(-1px);
}

.modal-footer .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(213, 116, 85, 0.2);
}

.modal-footer .btn-secondary {
  padding: 0.625rem 1.25rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.modal-footer .btn-secondary:hover {
  background: var(--bg-overlay);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Responsive footer */
@media (max-width: 768px) {
  .modal-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
  }

  .modal-meta {
    flex-direction: column;
    gap: var(--spacing-sm);
    width: 100%;
  }

  .modal-footer .btn-primary {
    width: 100%;
  }
}

/* ==================== ADDITIONAL MODAL IMPROVEMENTS ==================== */

/* Modal Header Enhancement */
.modal-title-section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  flex: 1;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.modal-badges {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Skill Description Section */


/* Section Titles */
.section-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-md);
}

.section-icon {
  font-size: 1.25rem;
}

/* Content Viewer Header */
.content-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-md);
  background: var(--bg-overlay);
  border-radius: 8px;
  border: 1px solid var(--border-primary);
}

.content-viewer-header .section-title {
  margin: 0;
  font-size: 1rem;
}

.content-viewer-header #currentFileName {
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  color: var(--accent-primary);
}

/* Content Viewer Improvements */
.content-viewer {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  padding: var(--spacing-lg);
  max-height: 600px;
  overflow: auto;
}

.content-viewer::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.content-viewer::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.content-viewer::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 4px;
}

.content-viewer::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.content-viewer pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.content-viewer code {
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-primary);
}

/* Modal Close Button */
.modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--bg-overlay);
  border-color: var(--danger);
  color: var(--danger);
  transform: scale(1.1);
}

.modal-close:active {
  transform: scale(0.95);
}

/* File Tree in Modal */
.skill-files-section {
  margin-top: var(--spacing-xl);
}

.skill-files-section .file-tree {
  max-height: 300px;
  overflow-y: auto;
}

.skill-files-section .file-tree::-webkit-scrollbar {
  width: 6px;
}

.skill-files-section .file-tree::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.skill-files-section .file-tree::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 3px;
}

.skill-files-section .file-tree::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* Modal Spacing */
.modal-body > * + * {
  margin-top: var(--spacing-xl);
}

/* Skill Context Section */
.skill-context-section {
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
}

.skill-tools-section {
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg);
  background: var(--bg-overlay);
  border-radius: 10px;
  border: 1px solid var(--border-primary);
}

/* Empty State in Modal */
.skill-content-section {
  margin-top: var(--spacing-xl);
  display: none;
  animation: fadeIn var(--transition-normal);
}

.skill-content-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== NEW: 3-LEVEL LOADING SYSTEM ==================== */

.skill-levels-section {
  padding: var(--spacing-lg) 0;
}

.section-description {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: var(--spacing-xl);
}

.loading-levels {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Level Card */
.level-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.level-1 {
  border: 2px solid rgba(213, 116, 85, 0.4);
  box-shadow: 0 2px 8px rgba(213, 116, 85, 0.1);
}

.level-2 {
  border: 2px solid rgba(46, 160, 67, 0.4);
  box-shadow: 0 2px 8px rgba(46, 160, 67, 0.1);
}

.level-3 {
  border: 2px solid rgba(163, 113, 247, 0.4);
  box-shadow: 0 2px 8px rgba(163, 113, 247, 0.1);
}

/* Level Header */
.level-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  position: relative;
}

.level-1 .level-header {
  background: linear-gradient(135deg, rgba(213, 116, 85, 0.12), rgba(213, 116, 85, 0.04));
}

.level-2 .level-header {
  background: linear-gradient(135deg, rgba(46, 160, 67, 0.12), rgba(46, 160, 67, 0.04));
}

.level-3 .level-header {
  background: linear-gradient(135deg, rgba(163, 113, 247, 0.12), rgba(163, 113, 247, 0.04));
}

.level-number {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}

.level-1 .level-number {
  background: rgba(213, 116, 85, 0.2);
  color: #ff9b7a;
  border: 3px solid rgba(213, 116, 85, 0.5);
}

.level-2 .level-number {
  background: rgba(46, 160, 67, 0.2);
  color: #56d364;
  border: 3px solid rgba(46, 160, 67, 0.5);
}

.level-3 .level-number {
  background: rgba(163, 113, 247, 0.2);
  color: #a371f7;
  border: 3px solid rgba(163, 113, 247, 0.5);
}

.level-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.level-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  text-transform: uppercase;
}

.level-timing {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.level-cost {
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.level-1 .level-cost {
  background: rgba(213, 116, 85, 0.2);
  color: #ff9b7a;
  border: 1px solid rgba(213, 116, 85, 0.4);
}

.level-2 .level-cost {
  background: rgba(46, 160, 67, 0.2);
  color: #56d364;
  border: 1px solid rgba(46, 160, 67, 0.4);
}

.level-3 .level-cost {
  background: rgba(163, 113, 247, 0.2);
  color: #a371f7;
  border: 1px solid rgba(163, 113, 247, 0.4);
}

/* Level Content */
.level-content {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-secondary);
}

.level-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: var(--spacing-md);
  font-style: italic;
}

/* Metadata Display (Level 1) */
.metadata-display {
  background: var(--bg-overlay);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: var(--spacing-md);
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.metadata-field {
  display: flex;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--border-secondary);
}

.metadata-field:last-child {
  border-bottom: none;
}

.field-label {
  font-size: 0.875rem;
  color: #ff9b7a;
  font-weight: 600;
  min-width: 140px;
  flex-shrink: 0;
}

.field-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  flex: 1;
}

.field-value-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.tool-chip-small {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  background: rgba(213, 116, 85, 0.15);
  border: 1px solid rgba(213, 116, 85, 0.3);
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #ff9b7a;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Instructions Display (Level 2) */
.instructions-display {
  background: var(--bg-overlay);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  padding: var(--spacing-md);
}

.file-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.file-item .file-icon {
  font-size: 1.25rem;
}

.file-item .file-name {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
}

.file-item .file-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Resources Display (Level 3+) */
.resources-display {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.resource-category {
  background: var(--bg-overlay);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  overflow: hidden;
}

.category-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-secondary);
}

.category-description {
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-muted);
}

.category-icon {
  font-size: 1.125rem;
}

.category-name {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-count {
  padding: 0.25rem 0.625rem;
  background: rgba(163, 113, 247, 0.15);
  border: 1px solid rgba(163, 113, 247, 0.3);
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #a371f7;
}

.category-files {
  padding: var(--spacing-sm);
}

.resource-file {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  border-radius: 6px;
  transition: all var(--transition-fast);
  font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.resource-file:hover {
  background: var(--bg-tertiary);
}

.resource-file .file-icon {
  font-size: 1rem;
}

.resource-file .file-name {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--text-primary);
}

.resource-file .file-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.empty-resources {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  gap: var(--spacing-sm);
  color: var(--text-muted);
}

.empty-resources .empty-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}

.empty-resources .empty-text {
  font-size: 0.875rem;
  font-style: italic;
}

/* Level Arrow */
.level-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: var(--spacing-lg) 0;
  position: relative;
  min-height: 60px;
}

.arrow-connector {
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, rgba(213, 116, 85, 0.6), rgba(163, 113, 247, 0.6));
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
}

.arrow-connector::after {
  content: '▼';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(163, 113, 247, 0.8);
  font-size: 1.2rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.level-arrow .arrow-label {
  position: relative;
  z-index: 2;
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 768px) {
  .level-header {
    flex-wrap: wrap;
  }

  .level-number {
    width: 40px;
    height: 40px;
    font-size: 1.125rem;
  }

  .level-cost {
    order: 3;
    width: 100%;
    text-align: center;
    margin-top: var(--spacing-sm);
  }

  .metadata-field {
    flex-direction: column;
    gap: 0.25rem;
  }

  .field-label {
    min-width: auto;
  }
}
